﻿#include "FITKAcousticsAbstractLoad.h"
#include "FITK_Kernel/FITKCore/FITKDataRepo.h"

namespace Acoustics
{
    FITKAcousticsAbstractLoad::FITKAcousticsAbstractLoad()
    {
        //构造
    }

    FITKAcousticsAbstractLoad::~FITKAcousticsAbstractLoad()
    {
        //析构
    }

    FITKAcousticsAbstractLoad::AcousticsLoadType FITKAcousticsAbstractLoad::getAcousticsLoadType()
    {
        //获取载荷类型
        return AcousticsLoadType::None;
    }

    void FITKAcousticsAbstractLoad::setEnabledState(bool enabled)
    {
        //设置启用状态
        _enabledState = enabled;
    }

    bool FITKAcousticsAbstractLoad::getEnabledState()
    {
        //获取启用状态
        return _enabledState;
    }

    void FITKAcousticsAbstractLoad::setNotes(QString notes)
    {
        //设置注释
        _notes = notes;
    }

    QString FITKAcousticsAbstractLoad::getNotes()
    {
        //获取注释
        return _notes;
    }

    void FITKAcousticsAbstractLoad::setConnectionObjID(int objID)
    {
        //设置连接对象id
        _connectObjID = objID;
    }

    int FITKAcousticsAbstractLoad::getConnectionObjID()
    {
        //获取连接对象id
        return _connectObjID;
    }

    QString FITKAcousticsAbstractLoad::getConnectionObjName()
    {
        Core::FITKAbstractNDataObject* connectionObj = FITKDATAREPO->getTDataByID<Core::FITKAbstractNDataObject>(_connectObjID);
        if (!connectionObj) return QString();
        return connectionObj->getDataObjectName();
    }

    void FITKAcousticsAbstractLoad::setConnectionLocation(double* location)
    {
        //设置连接位置
        _connectLocation[0] = location[0];
        _connectLocation[1] = location[1];
        _connectLocation[2] = location[2];
    }

    void FITKAcousticsAbstractLoad::getConnectionLocation(double* location)
    {
        location[0] = _connectLocation[0];
        location[1] = _connectLocation[1];
        location[2] = _connectLocation[2];
    }
}